//
//  LTableViewCell.m
//  tableview
//
//  Created by mac on 14-9-8.
//  Copyright (c) 2015年 党倬宇. All rights reserved.
//

#import "LTableViewCell.h"

@implementation LTableViewCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.btn2 = [[UIButton alloc]initWithFrame:CGRectMake(10, 5, 30, 30)];
        [self addSubview:self.btn2];
        
        self.jia = [[UIButton alloc]initWithFrame:CGRectMake(10, 40, 30, 30)];
        [self.jia setTitle:@"加" forState:(UIControlStateNormal)];
        self.jia.backgroundColor = [UIColor yellowColor];
        [self.jia setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        [self addSubview:self.jia];
        
        self.jie = [[UIButton alloc]initWithFrame:CGRectMake(100, 40, 30, 30)];
        [self.jie setTitle:@"减" forState:(UIControlStateNormal)];
        self.jie.backgroundColor = [UIColor yellowColor];
        [self.jie setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        [self addSubview:self.jie];
        
        self.number = [[UILabel alloc]initWithFrame:CGRectMake(50, 40, 40, 25)];
        self.number.textColor = [UIColor redColor];
        [self addSubview:self.number];
        
        self.price = [[UILabel alloc]initWithFrame:CGRectMake(200, 40, 60, 25)];
        self.price.textColor = [UIColor greenColor];
        [self addSubview:self.price];

        
        self.accprice = [[UILabel alloc]initWithFrame:CGRectMake(200, 80, 120, 25)];
        self.accprice.textColor = [UIColor greenColor];
        [self addSubview:self.accprice];
        
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(40, 5, 200, 30)];
        self.label.textColor =[UIColor redColor];
        [self addSubview:self.label];
    }
    return self;
}

- (void)setChecked:(BOOL)checked{
    if (checked)
    {
        [self.btn2 setImage:[UIImage imageNamed:@"Selected.png"] forState:(UIControlStateNormal)];
        //		self.m_checkImageView.image = [UIImage imageNamed:@"Selected.png"];
        self.backgroundView.backgroundColor = [UIColor colorWithRed:223.0/255.0 green:230.0/255.0 blue:250.0/255.0 alpha:1.0];
    }
    else
    {
        [self.btn2 setImage:[UIImage imageNamed:@"Unselected.png"] forState:(UIControlStateNormal)];
        self.backgroundView.backgroundColor = [UIColor whiteColor];
    }
    m_checked = checked;
    
    
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end


